package com.blinddate.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blinddate.mapper.ReachMapper;
import com.blinddate.pojo.entity.Reach;
import com.blinddate.service.ReachService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class ReachServiceImpl extends ServiceImpl<ReachMapper, Reach> implements ReachService {

    @Autowired
    private ReachMapper reachMapper;

    @Override
    public Map<String,Object> getTOShopCount(Long shopId, Integer day) {
        //得到某天前的到店情况
        Map<String,Object> shopCount = reachMapper.getTOShopCount(shopId, day);
        return shopCount;
    }

    @Override
    public Integer getMorTime(Long shopId) {
        Integer morTime = reachMapper.getMorTime(shopId);
        if (morTime==null||morTime==0){
            return 0;
        }
        return morTime;
    }
}
